package algoWing42.modelo;


public class HelicopteroPolicia extends Avion {
    /**
	 * 
	 */
	private static final long serialVersionUID = -5879666722616201536L;
	private int radioDeGiro;
    private int theta;
    private Punto centroDelCirculo;
    
    public static final int RADIO_HELICOPTERO = 30;
    public static final int ENERGIA_HELICOPTERO = 10;
    public static final int RADIO_DE_GIRO = 50;
    public static final int THETA_INICIAL = 5;
    public static final int SALTO_DE_ANGULO = 5; //dejar fijo

    public HelicopteroPolicia(int x, int y) {
        super(x, y, RADIO_HELICOPTERO);
        inicializarHelicopteroPolicia();
        }
    
    public HelicopteroPolicia(Punto posicion) {
        super(posicion.getX(), posicion.getY(), RADIO_HELICOPTERO);
        inicializarHelicopteroPolicia();
        }
    
    private void inicializarHelicopteroPolicia() {
    	this.energia = ENERGIA_HELICOPTERO;
    	this.radioDeGiro = RADIO_DE_GIRO;
        this.theta = THETA_INICIAL;
        this.centroDelCirculo = new Punto(this.getArea().getPosicion().getX() -
                this.radioDeGiro, this.getArea().getPosicion().getY());
    }

    /**
    * Movimiento circular uniforme.
    */
    @Override
    protected void mover() {
        int x = this.centroDelCirculo.getX() +
            (int) Math.round(this.radioDeGiro * (Math.cos(Math.toRadians(this.theta))));
        int y = this.centroDelCirculo.getY() +
            (int) Math.round(this.radioDeGiro * (Math.sin(Math.toRadians(this.theta))));
        this.moverA(x, y);
        this.theta = this.theta + SALTO_DE_ANGULO;
    }

    public int getRadio() {
        return this.radioDeGiro;
    }    
}
